package com.example.myapplication.fragment;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.example.myapplication.R;

import org.w3c.dom.Text;

public class FFActivity extends AppCompatActivity implements FragmentFA.MyListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ffactivity);

    }

    @Override
    public void sendValue(String value) {
        StaticFragment fg2=new StaticFragment();
        Bundle bundle=new Bundle();
        bundle.putString("mes",value);
        fg2.setArguments(bundle);
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.replace(R.id.fragment1,fg2);
        fragmentTransaction.commit();
        Log.i("fragment1向fragment2传递的数据是",value);
    }
}